import { createApp } from "vue";
import "./style.css";
import "animate.css";
import App from "./App.vue";
import router from "./router/index.js";
import ElementPlus from "element-plus";
import VueKinesis from "vue-kinesis";
import VWave from 'v-wave'
import "element-plus/theme-chalk/index.css";
import "./assets/js/libflex.js"; //可视化自适应
import { authDirective } from "./directives/authDirective.js";
//挂载store
import { createPinia } from "pinia";
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// 1 引入数据持久化插件
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
// 2 pinia使用数据持久化插件
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.directive('auth', authDirective);//全局挂载指令
app
  .use(pinia)
  .use(ElementPlus, { locale:zhCn, size: "medium" })
  .use(router)
  .use(VueKinesis)
  .use(VWave)
  .mount("#app");
